/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.workflow.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.hera.base.domain.BaseDomain;

/**
 *
 * @author cmontes
 */
@Entity
@Table(name = "PROCESS_CATEGORY")
public class ProcessCategory extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_PROCESS_CATEGORY")
    private Long idProcessCategory;
    private String name;
    private String icon;
    //@OneToMany(mappedBy = "processCategory")
    @Transient
    private List<ProcessCategory> processCategoryList;
    @JoinColumn(name = "ID_PARENT", referencedColumnName = "ID_PROCESS_CATEGORY")
    @ManyToOne
    private ProcessCategory processCategory;
    //@OneToMany(mappedBy = "processCategory")
    @Transient
    private List<Process> processList;

    public ProcessCategory() {
    }

    public ProcessCategory(Long idProcessCategory) {
        this.idProcessCategory = idProcessCategory;
    }

    public Long getIdProcessCategory() {
        return idProcessCategory;
    }

    public void setIdProcessCategory(Long idProcessCategory) {
        this.idProcessCategory = idProcessCategory;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }


    public List<ProcessCategory> getProcessCategoryList() {
        return processCategoryList;
    }

    public void setProcessCategoryList(List<ProcessCategory> processCategoryList) {
        this.processCategoryList = processCategoryList;
    }

    public ProcessCategory getProcessCategory() {
        return processCategory;
    }

    public void setProcessCategory(ProcessCategory processCategory) {
        this.processCategory = processCategory;
    }

    public List<Process> getProcessList() {
        return processList;
    }

    public void setProcessList(List<Process> processList) {
        this.processList = processList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idProcessCategory != null ? idProcessCategory.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof ProcessCategory)) {
            return false;
        }
        ProcessCategory other = (ProcessCategory) object;
        if ((this.idProcessCategory == null && other.idProcessCategory != null) || (this.idProcessCategory != null && !this.idProcessCategory.equals(other.idProcessCategory))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.ProcessCategory[ idProcessCategory=" + idProcessCategory + " ]";
    }
    
}
